package webEquipeRechercheGwt.client.handler.navigation;

import webEquipeRechercheGwt.client.abstractPanels.SoftwarePanelAbstract;
import webEquipeRechercheGwt.client.entityMirror.SoftwareMirror;
import webEquipeRechercheGwt.client.factory.WidgetFactory;
import webEquipeRechercheGwt.client.structure.DataShowingPanel;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

public class ClickHandlerSoftware implements ClickHandler {

	SoftwareMirror target;
	DataShowingPanel mainPanel;

	public ClickHandlerSoftware(SoftwareMirror software, DataShowingPanel mainPanel){
		super();
		this.mainPanel = mainPanel;
		target = software;
	}
	
	@Override
	public void onClick(ClickEvent event) {
		SoftwarePanelAbstract panel = WidgetFactory.getSoftwarePanel(target, mainPanel);
		mainPanel.setCurrentPanel(panel);
	}
}
